#include "widget.h"
#include "ui_widget.h"
#include<QRegExpValidator>
Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);
    //设置按钮默认是禁用的
    ui->pushButton->setEnabled(false);
    //给lineEdit注册一个validator
    ui->lineEdit->setValidator(new QRegExpValidator(QRegExp("^1\\d{10}$")));


}

Widget::~Widget()
{
    delete ui;
}

